home *** CD-ROM | disk | FTP | other *** search
/ 1st Multimedia Mac Shareware / Multimedia Shareware CD-ROM - BetaCorp.iso / Toolsƒ / Awayƒ / Away docs next >
Encoding:
Text File  |  1991-05-20  |  1.6 KB  |  60 lines  |  [TEXT/????]

  1. Instead of putting preferences files in the preferences folder, I set their
  2. invisible bits. I used to do this with DiskTop, but my version doesn't seem
  3. to work any more (yes, it's a legal copy, but old). I can do it with ResEdit,
  4. but it's too slow.
  5.  
  6. I was intrigued by the way that you can drop stuff into ResEdit, so I wrote
  7. a short application that hides any files that you drop into it. Take it just
  8. as a weird hack, I haven't tested this thing properly.
  9.  
  10. In Think C, the thing looks like:
  11.  
  12. /*
  13. >>    Obfuscator.c    This program hides all the files that are given to it.
  14. >>    
  15. >>    Copyright 1991, Juri Munkki
  16. >>    Feel free to use the code in your programs.
  17. */
  18.  
  19. void    ReadFinderStuff()
  20. {
  21.     int        message,count,i;
  22.     AppFile        thefile;
  23.     FileParam    block;
  24.     
  25.     CountAppFiles(&message,&count);
  26.     if(message==1)
  27.     {    return;
  28.     }
  29.     else
  30.     {    for(i=1;i<=count;i++)
  31.         {    GetAppFiles(i,&thefile);
  32.  
  33.             block.ioCompletion=0;
  34.             block.ioNamePtr=thefile.fName;
  35.             block.ioVRefNum=thefile.vRefNum;
  36.             block.ioFVersNum=thefile.versNum;
  37.             block.ioFDirIndex=0;
  38.  
  39.             PBGetFInfo(&block,0);
  40.             block.ioFlFndrInfo.fdFlags |= fInvisible;
  41.             PBSetFInfo(&block,0);
  42.         }
  43.     }
  44. }
  45.  
  46. void    main()
  47. {
  48.     InitGraf(&thePort);
  49.     InitCursor();
  50.     ReadFinderStuff();        
  51. }
  52.  
  53. Of course, you can't get the files back with the same program, but that's
  54. a minor problem...   ____________________________________________________________________________
  55. / Juri Munkki        /  Helsinki University of Technology   /  Wind  / Project/
  56. / jmunkki@hut.fi  /  Computing Center Macintosh Support  /  Surf  /  STORM  /
  57. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  58.  
  59.  
  60.